home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS04.ADF
/
image.ed
/
colors.c
< prev
next >
Wrap
C/C++ Source or Header
|
1985-10-26
|
3KB
|
95 lines
/************* colors.c******************/
/* this file contains the information required for the colors
* menu. It is a mix of graphics (the colors themselves) and
* text "modify these colors"
*/
#include "intuall.h"
#include "imageedit.h"
#define ITEMSTUFF (ITEMENABLED | HIGHBOX)
#define CW 40 /* color block width and height for color palette */
#define CH 25
extern struct TextAttr TestFont;
struct MenuItem cc;
struct IntuiText cctext;
struct Image colorimage[32]; /* provide for max possible */
struct MenuItem coloritem[32];
SHORT palette[] = { 2, 4, 8, 16, 32 };
InitColorItems( depth ) /* depending on depth of playfield,
* provide fewer items in the menu
*/
SHORT depth;
{
SHORT n,colors;
colors = palette[depth-1];
for(n=0; n<colors; n++)
{
coloritem[n].NextItem = &coloritem[n+1];
coloritem[n].ItemFill = (APTR)&colorimage[n];
coloritem[n].LeftEdge = 2 + CW * (n % 4);
coloritem[n].TopEdge = CH * (n / 4);
coloritem[n].Width = CW;
coloritem[n].Height = CH;
coloritem[n].Flags = ITEMSTUFF;
coloritem[n].MutualExclude = 0;
coloritem[n].SelectFill = NULL;
coloritem[n].Command = 0;
coloritem[n].SubItem = NULL;
coloritem[n].NextSelect = 0;
colorimage[n].LeftEdge = 1;
colorimage[n].TopEdge = 1;
colorimage[n].Width = CW-2;
colorimage[n].Height = CH-2;
colorimage[n].Depth = depth;
colorimage[n].ImageData = NULL;
colorimage[n].PlanePick = 0;
colorimage[n].PlaneOnOff = n;
}
coloritem[colors-1].NextItem = &cc;
Initcctext(depth);
return(0);
}
/* cc means color change, has to appear below lowest line of the
* color selection menu display.
*
* This is a case where you are mixing text and graphics in the
* same menu */
Initcctext(depth)
SHORT depth;
{
cc.NextItem = NULL;
cc.LeftEdge = 0;
cc.TopEdge = 4+ CH * ((palette[depth-1])>>2);
cc.Width = 160;
cc.Height = 10;
cc.Flags = ITEMTEXT | ITEMENABLED | HIGHBOX ;
cc.MutualExclude = 0;
cc.ItemFill = (APTR)&cctext;
cc.SelectFill = NULL;
cc.Command = 0;
cc.SubItem = NULL;
cc.NextSelect = 0;
cctext.FrontPen = 0;
cctext.BackPen = 1;
cctext.DrawMode = JAM2;
cctext.LeftEdge = 0;
cctext.TopEdge = 1;
cctext.ITextFont = &TestFont;
cctext.NextText = NULL;
cctext.IText = (UBYTE *)"Modify These Colors";
return(0);
}